package com.zl.controller.customer;

import com.zl.customer.json.RequestJsonParam;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author ZLL
 * @date create in 2018/04/27
 */
@Controller
@RequestMapping("/jsonparam")
public class JsonParamController {

    //ok   http://localhost:9080/springmvc-chapter6/jsonparam/list?list=[1,2,34]
    //fail http://localhost:9080/springmvc-chapter6/jsonparam/list?list=[1,2,a]
    @RequestMapping("/list")
    @ResponseBody
    public String list(@RequestJsonParam("list") List<Integer> list) {
        System.out.println(list);
        return "redirect:/success";
    }

}